package com.hkbigdata.sybx.service.ipml;

import com.hkbigdata.sybx.bean.Image;
import com.hkbigdata.sybx.mapper.ImageMapper;
import com.hkbigdata.sybx.service.ImageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigInteger;

/**
 * @author liuanbo
 * @creat 2025-05-30-13:22
 * @see 2194550857@qq.com
 */
@Service
public class ImageServiceImpl implements ImageService {
    @Autowired
    private ImageMapper imageMapper;

    @Override
    public boolean InsertImage(Image image) {
        if (imageMapper.insertImage(image) > 0) {
            return true;
        }
        return false;
    }

    @Override
    public Image SelectImage(String userId) {
        Image image = imageMapper.selectByUserId(userId);
        return image;
    }
    // 新增：实现修改图片的方法
    @Override
    public boolean updateImage(Image image) {
        int rows = imageMapper.updateImage(image);
        return rows > 0;
    }

}
